<?php
session_start();
$User_ID=$_SESSION['User_ID'];
?>
<?php

require_once("includes/database.php"); 





{	

$owner_User_ID_update = trim ($_POST['owner_User_ID_update']);
$pet_ID_update = trim ($_POST['pet_ID_update']);
$select_vaccine_type =  trim ($_POST['select_vaccine_type']);
$select_vaccine_order = trim ($_POST['select_vaccine_order']);
$select_veterinarian = trim ($_POST['select_veterinarian']);
$date_of_immunization = trim ($_POST['date_of_immunization']);
date_default_timezone_set ("Asia/Hong_Kong");
$timezone= date_default_timezone_get();	

$date =date("Y/m/d");

$tsql="UPDATE vaccine_db SET {$select_vaccine_type}{$select_vaccine_order}= '{$date_of_immunization} -Dr. {$select_veterinarian}'
WHERE Pet_ID='{$pet_ID_update}' and Owner_User_ID='{$owner_User_ID_update}'";

//sendEmail(getEmail($owner_User_ID_update),"Updated Immunization Date","From Petformance");

$data =  mysql_query($tsql,$con);

if( $data )
{
    /*echo "Connection established.\n";*/
	 $message = "Updating Immunization Date Successful!";
	 echo "<script type='text/javascript'>alert('$message');window.location = 'thesis_vet_page.php?page=1&pet_id=';</script>";
}
else
{
   $message = "Updating Immunization Date Failed.!";
	 echo "<script type='text/javascript'>alert('$message');window.location = 'thesis_vet_page.php?page=1&pet_id=';</script>";
     die( print_r( mysql_error(), true));
}
}

?>